<?php
/**
 * @author Mr Tuan - richdad.tx@gmail.com
 * @copyright 2012
 */
 
 
 
ini_set ('soap.wsdl_cache_enabled',0);
class ServiceFptController extends Controller
{
    /**
     * @param string $namespace 
     * @return string
     * @soap
     */
	 
    public function actions()
    {
       return array(
        'MOReceive' => array(
          'class' => 'CWebServiceAction',
        ),
      );
    }
    
    /**
     * @param integer $moid  
     * @param string $telco 
     * @param string $service_num
     * @param string $phone 
     * @param string $syntax
     * @param string $message
     * @return string
     * @soap
     */
    function Receive($moid, $telco, $service_num, $phone, $syntax, $message)
    {
	switch ($syntax)
	{
		case "abc":
			return "0|Noi dung tra ve cho cu phap ".$syntax;
		case "B":
			return "0|Noi dung tra ve cho cu phap ".$syntax;
	}

	   return "1|Cu phap khong hop le.";  
    }
    

    public function actionFpt(){
       // ini_set('display_errors','on');
        $wsdl = 'http://canhsong.com/Index.php/serviceFpt/MOReceive';
        $client = new SoapClient($wsdl);
        echo $client->Receive('123456','viettel','8011','84986812496','abc','aaaa');
    
   }
}